﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Comun.Queries
{
    public class Insert:QueryBuilder
    {
        public Insert() { }

        public Insert into(String tabla){
            this.tabla = tabla;
            return this;
        }

        public Insert columnas(String campos)
        {
            this.campos = campos;
            return this;
        }

        public Insert values(String clausulaWhere)
        {
            this.clausulaWhere = clausulaWhere;
            return this;
        }

        public override String build(){
            StringBuilder query = new StringBuilder();
            query.Append(INSERT).Append(this.tabla);
            query.Append((String.Empty.Equals(this.campos) ? "(" + this.campos + ")" : ""));
            query.Append(" VALUES (").Append(this.clausulaWhere).Append(")");
            return query.ToString();
        }
    }
}
